Skip to content

[log] Add debug logging to cmd/proxy#4134

Merged
lpcox merged 1 commit intomainfrom
log/proxy-cmd-debug-logging-9fc8f95db1c3b736
Apr 19, 2026
Merged

[log] Add debug logging to cmd/proxy#4134
lpcox merged 1 commit intomainfrom
log/proxy-cmd-debug-logging-9fc8f95db1c3b736

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Adds 5 new logProxyCmd debug log calls to internal/cmd/proxy.go to improve troubleshooting of the awmg proxy subcommand.

Changes

internal/cmd/proxy.go — reuses the existing logProxyCmd = logger.New("cmd:proxy") logger:

  • Log proxy server creation parameters before proxy.New (guard path, policy presence, DIFC mode, trusted bot/user counts)
  • Log successful proxy server creation
  • Log HTTP server creation with TLS state
  • Log when TLS configuration is applied to the HTTP server
  • Log entry to configureTLSTrustEnvironment (CA cert path + env var names)
  • Log successful TLS trust environment configuration

Usage

Enable with DEBUG=cmd:proxy ./awmg proxy ... or DEBUG=* ./awmg proxy ....

Validation

  • go build passes (GOTOOLCHAIN=auto go1.25.0)
  • go vet ./internal/cmd/... passes
  • gofmt clean
  • All unit tests pass (pre-existing TestFetchAndFixSchema_NetworkError failure is unrelated to this change and reproducible on main without my changes)

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • invalidhostthatdoesnotexist12345.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "invalidhostthatdoesnotexist12345.com"

See Network Configuration for more information.

Generated by Go Logger Enhancement · ● 5.8M ·

Adds 5 new logProxyCmd debug log calls to improve troubleshooting of
the proxy subcommand:

- Log proxy server creation parameters (guard path, policy presence,
  DIFC mode, trusted bot/user counts) before proxy.New
- Log successful proxy server creation
- Log HTTP server creation with TLS state
- Log when TLS configuration is applied to the HTTP server
- Log TLS trust environment setup (CA cert path and env vars being set)
- Log successful TLS trust environment configuration

These debug logs are controlled by DEBUG=cmd:proxy and write to both
stderr (colorized, with time diffs) and the gateway log file.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automation enhancement New feature or request labels Apr 19, 2026
@lpcox lpcox marked this pull request as ready for review April 19, 2026 21:47
Copilot AI review requested due to automatic review settings April 19, 2026 21:47
@lpcox lpcox merged commit 267904a into main Apr 19, 2026
15 checks passed
@lpcox lpcox deleted the log/proxy-cmd-debug-logging-9fc8f95db1c3b736 branch April 19, 2026 21:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds additional debug-level logging to the awmg proxy subcommand to make proxy startup/TLS/trust-env setup easier to troubleshoot when DEBUG=cmd:proxy is enabled.

Changes:

  • Log proxy server construction parameters and successful creation.
  • Log HTTP server creation and when TLS config is applied.
  • Log TLS trust environment configuration (entry + success).
Show a summary per file
File Description
internal/cmd/proxy.go Adds several new logProxyCmd debug log lines around proxy/TLS setup and trust-env configuration.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread internal/cmd/proxy.go
Comment on lines +206 to +207
logProxyCmd.Printf("Creating proxy server: guard=%s, hasPolicy=%v, mode=%s, trustedBots=%d, trustedUsers=%d",
proxyGuardWasm, proxyPolicy != "", proxyDIFCMode, len(proxyTrustedBots), len(proxyTrustedUsers))
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description says this change adds 5 new logProxyCmd debug log calls, but this diff introduces 6 new calls (creating proxy server, created successfully, creating HTTP server, applying TLS config, configuring trust env, trust env configured). Please update the PR description/count to match the actual changes.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants